@extends('home.layout.layout')
@section('title','帖子详情')
@section('con')
        <link rel="stylesheet" type="text/css" media="screen" href="{{asset('/HomeCss/News/css/941dd681021544fdbb252334af51ab14.css')}}" />
	
            <div class="hp-threeNav">
            <div class="hp-threeNav-bd">
            <ul class="hp-threeNav-item"><li><a href='/'  data-project='hupu' id='g_b'>首页</a></li></ul></div><i id='level2header' title=''></i>
                <div class="hp-search">
                    <form id="hp-form-search" method="get" enctype="multipart/form-data" action="/home/post/index">
                        <input type="text" value="搜索帖子" class="it-search" />
                        <input type="submit" value="搜索" class="btn-search" />
                    </form>
                </div>
            </div>
            
                
<div class="hp-wrap">
    


    <div id="container">
        <div id="container_nopadd">
          <div id="search_main">
<h2></h2>
<div class="bbs_head" style="margin-top:0">

<div class="breadCrumbs"><a href="" _hover-ignore="1">论坛</a> » <a href="/all-nba">{{$post->sname}}</a> » <i id="level2header" title="论坛"></i><a rel="index" href="">{{$post->bname}}</a> 版块</div>
<div class="bbs-hd-h1">
    <h1 id="j_data" data-title="{{$post->pname}}" tid="18242180"  data-replies="126" last="1484201595" csrftoken="4306b06d0c">{{$post->pname}}</h1>
    <span class="browse">{{$post->num}} 回复 &nbsp;&nbsp;  {{$post->ctr}} 浏览</span>
</div>



<script type="text/javascript" src=""></script>


{!! $fu->appends($list)->render() !!} 
<br>
<div>
<div id="tpc" class="floor">
<div class="user" style="z-index:39">
    <div class="j_u" uid="{{$post->uid}}" uname="{{$post->username}}">
        <a class="headpic" target="_blank" href=""><img src="{{$post->pic}}" alt="" height="45" width="45"></a>
</div>

</div>
<div class="floor_box">
    <div class="author"><div class="left"><a class="u" target="_blank" href="">{{$post->username}}</a>  <span class="f666">(<a title="" target="_blank" href="">8级</a>)</span> <span class="post-owner">楼主</span>&nbsp;<span class="stime">{{$post->pctime}}</span>

</div>
<div class="right f666">





<a title="收藏本帖到“我的空间”" pid="{{$post->pid}}" onclick="addFavor();return false;"  rel="nofollow" href="javascript:void(0)">收藏本帖</a>
<input type="hidden" class="shoucang" name="pid" value="{{$post->pid}}">
</div></div>

<table class="case" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td>

<div class="subhead"><span>{{$post->pname}}</span> &nbsp;由 {{$post->username}} 发表在 虎扑篮球·<a href="http://bbs.hupu.com/vote">{{$post->sname}} </a> 的 <a href="http://bbs.hupu.com/vote"> {{$post->bname}} </a>版块 </div>

{!! $post->pcont !!}

</td>
</tr></tbody></table>

   

<!--推荐-->
<table class="cm" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td>

<div class="bbs-sponsor-gold">
    <span class="pay-btn">
        <span style="position:relative;" class="zanzhu clearfix">
        </span>
    </span>
    <div class="gold-users"></div>
</div>

<div class="right" style="width:505px;"><div class="commend01" style="float:right;">
<span id="rm_list_div">

</span>


<span id="shareTo" class="rel">

   
</span></div></div>
</td></tr></tbody></table>

            </div><div class="clearfix"></div></div>
            <br>

        @if(!empty($fuzan))
            <div class="w_reply clearfix" style="width:1162px;"><h5 style="height:30px;" id="highlights"><span >这些回帖看着不错</span></h5>
            <br>
            <div id="readfloor">
        @foreach($fuzan as $k=>$v)
            <div class="floor" id="26889" style="z-index:79">
            <div class="user">
                <div uname="{{$v->username}}" uid="{{$v->uid}}" class="j_u">
                    <a href="" target="_blank" class="headpic"><img src="{{$v->pic}}" alt="{{$v->username}}" height="45" width="45"></a>
                </div>
            </div>
            <div class="floor_box">
                <div class="author">
                    <div class="left">
                        <a class="u" href="#" target="_blank">{{$v->username}}</a>  
                            <span class="stime">{{$v->fctime}}</span>
                            &nbsp;<span class="f444 26889" pid="{{$v->fpid}}" uid="29833188" style="position:relative">
                            <span class="ilike_icon_list">
                            <a  class="dianzan" pid="{{$v->fid}}" href="javascript:void(0)"  >赞</a>(<span class="stime">{{$v->lnum}}</span>)</span></span>
                    </div>
                    <div class="right f666"></div>
                </div>
            <table class="case" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td>

            <br>{!! $v->fcont !!}<br><br><small class="f666" style="display:block;clear:both;">[ 发自 {{$v->browser}} ]</small>

            </td></tr></tbody></table>

            <div class="reply-sponsor-users"></div>

                
            </div><div class="clearfix"></div></div>
            <br>

        @endforeach    

        @endif
</div>
</div>
        @if(empty($fu))
        
        <div id="" class="floor">
        

        </div>
        <div class="floor_box" style="text-align:center;">
            <div class="author">
        <div class="right f666">
        </div></div>

        <div class="liangShare"></div>
        <table class="case"  cellspacing="0" cellpadding="0" border="0">
        <span style="font-size:26px; ">沙发好寂寞 T_T.........</span>
       </table>
        <div class="reply-sponsor-users"></div>
            <div class="liangShare"></div>
        </div><div class="clearfix"></div></div>

        @endif
        <?php $num = 0 ; ?>
        @foreach($fu as $k=>$v)
        <?php $num ++ ; ?>
        <div id="{{$v->fid}}" class="floor">
        <div class="user" style="z-index:38">
            <div class="j_u" uid="{{$v->uid}}" uname="{{$v->username}}">
                <a class="headpic" target="_blank" href=""><img src="{{$v->pic}}" alt="{{$v->username}}" height="45" width="45"></a>
        </div>

        </div>
        <div class="floor_box">
            <div class="author"><div class="left"><a class="u" target="_blank" href="#">{{$v->username}}</a>   <span class="stime">{{$v->fctime}}</span>

        &nbsp;<span class="f444 26839" pid="26839" uid="19447099" style="position:relative">
        <span class="ilike_icon_list"><a class="dianzan" pid="{{$v->fid}}" href="javascript:void(0)" dace_clk="clk_bbs_rlights">赞</a>(<span class="stime">{{$v->lnum}}</span>)</span></span>

        </div>
        <div class="right f666">

        
        <a href="javascript:void(0);" onclick="">举报</a>

        
        <a id="{{$num}}" class="floornum" title="" href="">{{$num}}楼</a>

        </div></div>

        <table class="case" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td>

        {!! $v->fcont !!}<br><br><small class="f999"></small><small class="f666" style="display:block;clear:both;">[ 发自 {{$v->browser}} ]</small>

        </td>
        </tr></tbody></table>

        <div class="reply-sponsor-users"></div>

            <div class="liangShare"></div>

        </div><div class="clearfix"></div></div>
        @endforeach
        {!! $fu->appends($list)->render() !!}   
        <form action="{{url('/home/post/followup')}}" method="post">

      @if(!empty(session('uid')))
    <div class="commont-box J_commentTextarea">
        <a name="reply"></a>
        <p class="userAvatar"> 
            <a target="_blank" href="#"><img style="width:50px;height:50px" src="{{session('pic')}}"></a>
        </p>
        <div class="bd">
            
            <div class="textarea-box" style="border: 1px solid #ddd;width:593px;">
                <textarea class="comments_content" style="border: 1px solid #fff;width:590px;" name="fcont"></textarea>
                    <div class="textarea-tip">
                        快来发表您对这条新闻的看法吧!
                    </div>              
            </div>
            <div class="bot">
                <div class="bot-right">
                    <input  value="评论" class="voice-simple-btn btn-submit J_btn_reply comments" type="submit">
                </div>
            </div>
        </div>
    </div>

    @else

    <div class="commont-box J_commentTextarea">
        <a name="reply"></a>
        <p class="userAvatar"> 
            <a target="_blank" href="#">
                <img src="{{asset('/HomeCss/News/picture/default_small.jpg')}}">
            </a>   
        </p>

        <div class="bd">
            <input type="hidden" name="messgae_id" value="2112597">
            <div class="textarea-box">
                <textarea name="content"></textarea>
                    <div class="textarea-tip">
                         快来发表您对这条新闻的看法吧!
                    </div>              
            </div>
            <div class="textarea-message" style="height:58px;line-height:50px;">
                    您需要登录才可以评论，请&nbsp <a href="{{url('/home/login/login')}}" target="_blank">登录</a>&nbsp或者&nbsp <a href="{{url('/home/login/regist')}}" target="_blank">立即注册</a>            
            </div>
             <div id="J_editor" style="width:100%;overflow:hidden;"></div>
            <div class="bot">
                <div class="bot-right">
                    <input type="submit" value="评论" class="voice-simple-btn btn-submit J_btn_reply">
                </div>
            </div>
        </div>
    </div>
    @endif 



            <input type="hidden" name="fpid" value="{{$post->pid}}" fcont>
            {{csrf_field()}}
            
        </form>
</div>
@endsection

@section('js')
<script type="text/javascript">

   $('.dianzan').click(function(){
        var str = $(this);
        var pid = str.attr('pid');
        var num = str.next().html();
        $.get('/home/post/addzan',{pid:pid},function(data){
            if (data == 1) {
               //修改成功
                num ++;
                str.next().html(num);
                str.css('color','red'); 
            }else{
               //修改失败
               alert('点赞失败,请稍候再试..');
            }
        });
        
   });


    
    function addFavor()
    {
      var pid =  $('.shoucang').val();
      $.get('/home/post/shoucang',{pid:pid},function(data){
        if (data == 2) {
            alert('您已经收藏过了..');
        }else if (data == 1){
            alert('收藏成功..');
        }else{
            alert('收藏失败..');
        }
      });
      
    }

    
</script>
@endsection